<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function fn(a) {
            var s = a + "";
            var arr = [0, 0, 0, 0];
            for (var i = 0; i < s.length; i++) {
                var res = (parseInt(s[i]) + 5) % 10
                arr[i] = res + ""
            }
            var aa = 0;
            aa = arr[0];
            arr[0] = arr[3];
            arr[3] = aa;
            aa = arr[1];
            arr[1] = arr[2];
            arr[2] = aa;
            document.write(arr)
        }
        var a = prompt("传入原文", "1234")
        fn(a);
    </script>
</head>

<body>

</body>

</html>